package com.gwt.client;

import com.google.gwt.event.shared.EventBus;
import com.google.gwt.event.shared.SimpleEventBus;
import com.google.gwt.place.shared.PlaceController;
import com.google.gwt.user.client.Window;
import com.gwt.client.ui.Slide;
import com.gwt.client.ui.Slide1;
import com.gwt.client.ui.Slide10;
import com.gwt.client.ui.Slide11;
import com.gwt.client.ui.Slide12;
import com.gwt.client.ui.Slide13;
import com.gwt.client.ui.Slide14;
import com.gwt.client.ui.Slide15;
import com.gwt.client.ui.Slide2;
import com.gwt.client.ui.Slide3;
import com.gwt.client.ui.Slide4;
import com.gwt.client.ui.Slide5;
import com.gwt.client.ui.Slide6;
import com.gwt.client.ui.Slide7;
import com.gwt.client.ui.Slide8;
import com.gwt.client.ui.Slide9;

public class ClientFactoryImpl implements ClientFactory{
	
	private static final EventBus eventBus = new SimpleEventBus();
	private static final PlaceController placeController = new PlaceController(eventBus);
	
	private static final Slide slide1 = new Slide1(eventBus);
	private static final Slide slide2 = new Slide2(eventBus);
	private static final Slide slide3 = new Slide3(eventBus);
	private static final Slide slide4 = new Slide4(eventBus);
	private static final Slide slide5 = new Slide5(eventBus);
	private static final Slide slide6 = new Slide6(eventBus);
	private static final Slide slide7 = new Slide7(eventBus);
	private static final Slide slide8 = new Slide8(eventBus);
	private static final Slide slide9 = new Slide9(eventBus);
	private static final Slide slide10 = new Slide10(eventBus);
	private static final Slide slide11 = new Slide11(eventBus);
	private static final Slide slide12 = new Slide12(eventBus);
	private static final Slide slide13 = new Slide13(eventBus);
	private static final Slide slide14 = new Slide14(eventBus);
	private static final Slide slide15 = new Slide15(eventBus);

	@Override
	public EventBus getEventBus() {
		return eventBus;
	}

	@Override
	public PlaceController getPlaceController() {
		return placeController;
	}

	@Override
	public Slide getSlide(int slideNumber) {
		switch(slideNumber){
			case 1 : 
				return slide1;
			case 2 :
				return slide2;
			case 3 :
				return slide3;
			case 4 :
				return slide4;
			case 5 :
				return slide5;
			case 6 :
				return slide6;
			case 7 :
				return slide7;
			case 8 :
				return slide8;
			case 9 :
				return slide9;
			case 10 :
				return slide10;
			case 11 :
				return slide11;
			case 12 :
				return slide12;
			case 13 :
				return slide13;
			case 14 :
				return slide14;
			case 15 :
				return slide15;
			default :
				Window.alert("invalid slide number");
				return null;
		}
	}
}
